#!/bin/sh
if [ $# -ne 1 ]; then
    echo "run.sh URL"
    exit
fi
[ -d data ] || mkdir data
sed -ie 's/QINGSTOR_URL/$1/g' nginx.conf
docker run --rm --name ngx -v $PWD/nginx.conf:/etc/nginx/nginx.conf:ro \
    -v $PWD/data:/data/nginx/cache \
    -p 1086:80 \
    nginx:alpine
